import request from "@/utils/request";

// 查询患者基本信息列表
export function listBaseInfo(query) {
  return request({
    url: "/workstation/baseInfo/list",
    method: "get",
    params: query,
  });
}

// 查询患者基本信息详细
export function getBaseInfo(id) {
  return request({
    url: "/workstation/baseInfo/" + id,
    method: "get",
  });
}

// 出院
export function leave(id) {
  return request({
    url: "/workstation/baseInfo/leave/" + id,
    method: "get",
  });
}

// 新增患者基本信息
export function addBaseInfo(data) {
  return request({
    url: "/workstation/baseInfo",
    method: "post",
    data: data,
  });
}

// 修改患者基本信息
export function updateBaseInfo(data) {
  return request({
    url: "/workstation/baseInfo",
    method: "put",
    data: data,
  });
}

// 删除患者基本信息
export function delBaseInfo(id) {
  return request({
    url: "/workstation/baseInfo/" + id,
    method: "delete",
  });
}

// 保存入院药学评估
export function pharmacyAssess(data) {
  return request({
    url: "/workstation/pharmacyAssess",
    method: "post",
    data: data,
  });
}

// 查询入院药学评估详细信息
export function medicalRecodeNo(medicalRecodeNo) {
  return request({
    url: "/workstation/pharmacyAssess/" + medicalRecodeNo,
    method: "get",
  });
}

// 保存药历首页信息
export function medicationRecordPost(data) {
  return request({
    url: "/workstation/medicationRecord",
    method: "post",
    data: data,
  });
}

// 获取药历首页信息详细信息
export function medicationRecordGet(medicalRecodeNo) {
  return request({
    url: "/workstation/medicationRecord/" + medicalRecodeNo,
    method: "get",
  });
}

// 查询诊断信息列表
export function admittingDiagInfo(query) {
  return request({
    url: "/workstation/admittingDiagInfo/list",
    method: "get",
    params: query,
  });
}

// 查询药历用药汇总列表
export function medicalRecordlist(query) {
  return request({
    url: "/workstation/medicalRecord/list",
    method: "get",
    params: query,
  });
}

// 根据病历号获取用药建议信息
export function pillSuggest(medicalRecodeNo) {
  return request({
    url: "/workstation/pillSuggest/" + medicalRecodeNo,
    method: "get",
  });
}

// 修改患者用药建议信息
export function updatepillSuggest(data) {
  return request({
    url: "/workstation/pillSuggest",
    method: "put",
    data: data,
  });
}

// 根据病历号获取用药教育信息
export function pillEducation(medicalRecodeNo) {
  return request({
    url: "/workstation/pillEducation/" + medicalRecodeNo,
    method: "get",
  });
}

// 修改患者用药教育信息
export function updatepillEducation(data) {
  return request({
    url: "/workstation/pillEducation",
    method: "put",
    data: data,
  });
}

// 根据病历号获取患者历史药历
export function history(query) {
  return request({
    url: "/workstation/baseInfo/history",
    method: "get",
    params: query,
  });
}

// 根据病历号获取用药教育信息
export function medicalOrders(medicalRecodeNo) {
  return request({
    url: "/workstation/medicalOrders/list/" + medicalRecodeNo,
    method: "get",
  });
}

// 根据病历号获取用药教育信息  带分组
export function medicalOrderscategory(medicalRecodeNo, category) {
  return request({
    url: "/workstation/medicalOrders/list/" + medicalRecodeNo + "/" + category,
    method: "get",
  });
}

// 根据病历号获取用药时间轴
export function shaft(medicalRecodeNo, type) {
  return request({
    url: "/workstation/shaft/" + medicalRecodeNo + "/" + type,
    method: "get",
  });
}

// 根据病历号获取用药时间轴
export function group(medicalRecodeNo, type) {
  return request({
    url: "/workstation/shaft/group/" + medicalRecodeNo + "/" + type,
    method: "get",
  });
}

// 获取验证票据
export function getTicket() {
  return request({
    url: "/system/user/getTicket",
    method: "get",
  });
}

// 获取医学一级监护信息详细信息
export function firstLevel(medicalRecordNo) {
  return request({
    url: "/workstation/firstLevel/" + medicalRecordNo,
    method: "get",
  });
}

// 新增或修改一级监护信息
export function firstLevelPost(data) {
  return request({
    url: "/workstation/firstLevel",
    method: "post",
    data: data,
  });
}

// 获取医学一级监护分级信息详细信息
export function gradingFirst(medicalRecordNo) {
  return request({
    url: "/workstation/gradingFirst/" + medicalRecordNo,
    method: "get",
  });
}

// 新增或修改一级监护信息
export function gradingFirstPost(data) {
  return request({
    url: "/workstation/gradingFirst",
    method: "post",
    data: data,
  });
}

// 获取医学二级监护信息详细信息
export function twoLevel(medicalRecordNo) {
  return request({
    url: "/workstation/twoLevel/" + medicalRecordNo,
    method: "get",
  });
}

// 新增或修改二级监护信息
export function twoLevelPost(data) {
  return request({
    url: "/workstation/twoLevel",
    method: "post",
    data: data,
  });
}

// 获取医学二级监护分级信息详细信息
export function gradingTwo(medicalRecordNo) {
  return request({
    url: "/workstation/gradingTwo/" + medicalRecordNo,
    method: "get",
  });
}
  
// 新增或修改二级监护信息
export function gradingTwoPost(data) {
  return request({
    url: "/workstation/gradingTwo",
    method: "post",
    data: data,
  });
}

// 获取医学监护标红项信息
export function gradingFirstred(medicalRecordNo) {
  return request({
    url: "/workstation/gradingFirst/red/" + medicalRecordNo,
    method: "get",
  });
}

// 获取医学监护标红项信息
export function red(medicalRecordNo) {
  return request({
    url: "/workstation/firstLevel/red/" + medicalRecordNo,
    method: "get",
  });
}

// 查询患者监护分级
export function guardianLevel(medicalRecordNo) {
  return request({
    url: "/workstation/baseInfo/guardianLevel/" + medicalRecordNo,
    method: "get",
  });
}

// 查询药品信息列表
export function medicineInfoList(query) {
  return request({
    url: "/workstation/medicineInfo/list",
    method: "get",
    params: query,
  });
}

// 获取不良反应参数拼接字符串
export function adr(userId) {
  return request({
    url: "/workstation/baseInfo/adr/" + userId,
    method: "get",
  });
}